﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using StructureMap.Configuration.DSL;
using Universum.Infrastructure.Persistence;

namespace Universum.Infrastructure.Configuration
{
	public class RepositoryRegistry : Registry
	{
		public RepositoryRegistry()
		{
			ForRequestedType<IUnitOfWork>().TheDefault.Is.ConstructedBy(ctx => ctx.GetInstance<IDb4oUnitOfWork>());

			ForRequestedType<IDb4oUnitOfWork>()
				.TheDefaultIsConcreteType<Db4oUnitOfWork>();
			ForRequestedType<IRepository>()
				.TheDefaultIsConcreteType<Db4oRepository>();
		}
	}
}
